<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<!-- 侧边栏 -->
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar" th:fragment="sideBar">

    <!-- Sidebar - Brand -->
    <a class="sidebar-brand d-flex align-items-center justify-content-center" th:href="@{/}">
        <div class="sidebar-brand-icon rotate-n-15">
            <i class="fas fa-plane"></i>
        </div>
        <div class="sidebar-brand-text mx-3">航空票务系统</div>
    </a>

    <!-- Divider -->
    <hr class="sidebar-divider my-0">

    <!-- Nav Item - Dashboard -->
    <li class="nav-item">
        <a id="navchart" class="nav-link" th:href="@{/admin}">
            <i class="fas fa-fw fa-tachometer-alt"></i>
            <span>报表</span></a>
    </li>

    <!-- Divider -->
    <hr class="sidebar-divider">


    <li class="nav-item">
        <a id="nav0" class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapse0" aria-expanded="true" aria-controls="collapseTwo">
            <i class="fas fa-fw fa-cog"></i>
            <span>执飞航班、舱位管理</span>
        </a>
        <div id="collapse0" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">执飞航班、舱位:</h6>
                <a class="collapse-item" >执飞航班</a>
                <a class="collapse-item" th:href="@{#aircraftModelManagementTab}">舱位</a>
            </div>
        </div>
    </li>

    <li class="nav-item">
        <a id="nav1" class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
            <i class="fas fa-plane"></i>
            <span>航线、机型管理</span>
        </a>
        <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">航线、机型:</h6>
                <a class="collapse-item" th:href="@{/admin/flight}">航线</a>
                <a class="collapse-item" th:href="@{/admin/flight#aircraftModelManagementTab}">机型</a>
            </div>
        </div>
    </li>


    <li class="nav-item">
        <a id="nav2" class="nav-link collapsed" th:href="@{/admin/location}" data-toggle="collapse" data-target="#collapseUtilities" aria-expanded="true" aria-controls="collapseUtilities">
            <i class="fas fa-map-marked-alt"></i>
            <span>地域、场地管理</span>
        </a>
        <div id="collapseUtilities" class="collapse" aria-labelledby="headingUtilities" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">地域、场地信息:</h6>
                <a class="collapse-item" th:href="@{/admin/location}" >机场管理</a>
                <a class="collapse-item" th:href="@{/admin/location#cityManagementTab}" >城市管理</a>
                <a class="collapse-item" th:href="@{/admin/location#countryManagementTab}" >国家及区域管理</a>
            </div>
        </div>
    </li>

    <!-- Divider -->
    <hr class="sidebar-divider d-none d-md-block">

    <!-- Sidebar Toggler (Sidebar) -->
    <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
    </div>
</ul>
<!-- 侧边栏结束 -->

<!-- 顶部栏 -->
<nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow" th:fragment="topBar">

    <!-- Sidebar Toggle (Topbar) -->
    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
        <i class="fa fa-bars"></i>
    </button>

    <!-- Topbar Navbar -->
    <ul class="navbar-nav ml-auto">

        <!-- Nav Item - Search Dropdown (Visible Only XS) -->
        <li class="nav-item dropdown no-arrow d-sm-none">
            <a class="nav-link dropdown-toggle" href="#" id="searchDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="fas fa-search fa-fw"></i>
            </a>
            <!-- Dropdown - Messages -->
            <div class="dropdown-menu dropdown-menu-right p-3 shadow animated--grow-in" aria-labelledby="searchDropdown">
                <form class="form-inline mr-auto w-100 navbar-search">
                    <div class="input-group">
                        <input type="text" class="form-control bg-light border-0 small" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2">
                        <div class="input-group-append">
                            <button class="btn btn-primary" type="button">
                                <i class="fas fa-search fa-sm"></i>
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </li>

        <div class="topbar-divider d-none d-sm-block"></div>

        <!-- Nav Item - User Information -->
        <li class="nav-item dropdown no-arrow" th:switch="${session.id}">
            <a th:case="null" class="nav-link " th:href="@{/login}" role="button" aria-haspopup="true" aria-expanded="false">
                <span class="mr-2 d-none d-lg-inline text-gray-600 small">登录</span>
                <i class="fas fa-sign-in-alt"></i>
            </a>
            <a th:case="*" class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="mr-2 d-none d-lg-inline text-gray-600 small" th:text="${session.id}"></span>
                <i class="far fa-user-circle"></i>
            </a>
            <!-- Dropdown - User Information -->
            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown">
                <a class="dropdown-item" th:if="${session.permission}==1" th:href="@{/admin}">
                    <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>
                    后台管理
                </a>
                <a class="dropdown-item" th:if="${session.permission}==0" th:href="@{/user/update}">
                    <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>
                    修改个人信息
                </a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" th:href="@{/logout}">
                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                    登出
                </a>
            </div>
        </li>
    </ul>
</nav>
<!-- 顶部栏结束 -->

<!-- 页脚 -->
<footer class="sticky-footer bg-white" th:fragment="footer">
    <div class="container my-auto">
        <div class="copyright text-center my-auto">
            <span>Copyright &copy;  2020</span>
        </div>
    </div>
</footer>
<!-- 页脚结束 -->

<!-- 登出模态框 -->
<div class="modal fade" id="tmpModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" th:fragment="tmpModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="tmpModalTitle">Ready to Leave?</h5>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div id="tmpModalBody" class="modal-body"></div>
            <div id="tmpModalFooter" class="modal-footer">
                <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
                <!-- <a class="btn btn-primary" href="login.html">Logout</a>-->
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="ticketModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" th:fragment="ticketModel">
    <div class="modal-dialog modal-lg" role="document" style="max-width: 1600px;">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="ticketModelTitle">机票类型管理</h5>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div id="ticketModelBody" class="modal-body">
                <table class="table table-bordered" id="dataTable2" width="100%" cellspacing="0">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th width="80px">舱位等级</th>
                        <th width="80px">销售价格</th>
                        <th width="70px">折扣</th>
                        <th width="70px">总数</th>
                        <th width="70px">余量</th>
                        <th width="80px">行李限重</th>
                        <th>改退签规则</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tfoot>
                    <tr>
                        <th></th>
                        <th width="80px">
                            <select id="addTicketTypeCabin" class="form-control">
                                <option th:each="cabin : ${cabinMap.values()}"  th:value="${cabin.cabinID}" th:text="${cabin.cabinClass}"></option>
                            </select>
                        </th>
                        <th width="80px"><input id="addTicketTypePrice" type="number" min="0.00" step="0.01" class="form-control" placeholder="销售价格"/></th>
                        <th width="70px"><input id="addTicketTypeDisCount" type="number" min="0.00" step="0.01" class="form-control" placeholder="折扣"/></th>
                        <th width="70px"><input id="addTicketTypeCount" type="number" min="0" step="1" class="form-control" placeholder="总数"/></th>
                        <th width="70px"><input id="addTicketTypeRemaining" type="number" min="0" step="1" class="form-control" placeholder="余量"/></th>
                        <th width="80px"><input id="addTicketTypeLuggageLimit" type="number" min="0.00" step="0.01" class="form-control" placeholder="行李限重"/></th>
                        <th><textarea id="addTicketTypeRule" type="text" class="form-control" placeholder="改退签规则"></textarea></th>
                        <th class="text-center">
                            <button id="addTicketTypeBtn" class="btn-sm btn-primary btn-icon-split">
                                <span class="icon text-white-50"><i class="fas fa-plus-square"></i></span>
                            </button>
                        </th>
                    </tr>
                    </tfoot>
                    <tbody id="TicketTypeBody"></tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</html>